<?php
/**
 * 基础类 单例模式
 * User: zucheng
 * Date: 2019/3/28
 */

namespace App\Services;

abstract class BaseService
{
    protected static $instance;

    protected function __construct()
    {
    }

    /**
     * 获取实例对象
     * @return mixed
     */
    public static function getInstance()
    {
        if (!isset(static::$instance[static::class])) {
            static::$instance[static::class] = new static();
        }
        return static::$instance[static::class];
    }

    protected function __clone()
    {
    }

}